home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / infoserv / www / cern / dev / www-talk.9301-9306.Z / www-talk.9301-9306 / text0084.txt < prev    next >
Encoding:
Text File  |  1995-04-24  |  2.1 KB  |  79 lines

  1. Hi,
  2.  
  3. when i have tried to create a telnet session than
  4.  
  5. 1) it used the rlogin instead of the telnet
  6. 2) the way the rlogin is used is wrong.. it sends the command
  7.    RLOGINtelnet /username= ...  WITHOUT THE HOSTNAME
  8.  
  9.  
  10. C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++C
  11. HTACCESS.C   as it is now
  12. C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++C
  13.  
  14.     BOOL rlogin = strcmp(access, "rlogin");
  15.     .
  16.     .
  17.     .
  18.  
  19.     if (!rlogin) {            /* telnet */
  20.         if (user) printf("When you are connected, log in as %s\n", user);
  21.         sprintf(command, "TELNET %s%s %s",
  22.         port ? "/PORT=" : "",
  23.         port ? port : "",
  24.         hostname);
  25.     } else {
  26.         sprintf(command, "RLOGIN%s%s%s%s %s", access,
  27.         user ? "/USERNAME=" : "",
  28.         user ? user : "",
  29.         port ? "/PORT=" : "",
  30.         port ? port : "",
  31.         hostname);
  32.     }
  33.     if (TRACE) fprintf(stderr, "HTaccess: Command is: %s\n", command);
  34.     system(command);
  35.     return HT_NO_DATA;        /* Ok - it was done but no data */
  36.  
  37. C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++C
  38. correct code is :
  39. C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++C
  40. HTACCESS.C
  41.  
  42.     BOOL rlogin = strcmp(access, "rlogin");
  43.     .
  44.     .
  45.     .
  46.  
  47.     if (rlogin) {            /* telnet */
  48.         if (user) printf("When you are connected, log in as %s\n", user);
  49.         sprintf(command, "TELNET %s%s %s",
  50.         port ? "/PORT=" : "",
  51.         port ? port : "",
  52.         hostname);
  53.     } else {
  54.         sprintf(command, "RLOGIN%s%s%s%s %s",
  55.         user ? "/USERNAME=" : "",
  56.         user ? user : "",
  57.         port ? "/PORT=" : "",
  58.         port ? port : "",
  59.         hostname);
  60.     }
  61.     if (TRACE) fprintf(stderr, "HTaccess: Command is: %s\n", command);
  62.     system(command);
  63.     return HT_NO_DATA;        /* Ok - it was done but no data */
  64.  
  65. C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++C
  66.  
  67.  
  68.                                               thanks
  69.                                               __o     o__
  70.                                          _ \<,_   _.>/ _
  71.                                         (_)/ (_) (_) \(_)
  72.  
  73.                                              d    u   d    u
  74.                                              Hebrew University
  75.                                              Computation Center
  76.                                              Jerusalem, Israel
  77.  
  78.  
  79.